<template>
  <div>
    <h1>{{ mess }}</h1>
    <button @click="end">router</button>
    <button @click="btn">退出登录</button>
  </div>
</template>

<script>
import router from '@/router'
export default {
  created() {
    this.obj.id = this.$route.params.id
    this.obj.name = this.$route.params.name
    this.date = this.$route.query.name
  },
  mounted() {
    console.log(this.data);
    const tishi = this.mes
    const name = this.date
    this.mess = name == '小明' ? `${tishi}成功` : `${tishi}失败`
  },
  methods: {
    jiami(){

    },
    btn() {
      localStorage.removeItem('token')
      sessionStorage.removeItem('ststue')
      console.log(router.name)
      router.push('/login')
    },
    end() {}
  },
  data() {
    return {
      obj: { id: null, name: null },
      date: '',
      mes: '登录',
      mess: ''
    }
  }
}
</script>

<style></style>
